package com.exercise.rpc.client;/**
 * Created by kete on 2018-10-26.
 */

import com.exercise.rpc.client.proxy.ObjectProxy;
import com.exercise.rpc.common.registry.ServiceDiscovery;
import java.lang.reflect.Proxy;

/**
 * 作者：kete
 * 创建时间：2018-10-26 15:17
 * 功能描述：
 * 版本：
 */
public class ServerClient {
    private ServiceDiscovery discovery;

    public ServerClient(ServiceDiscovery discovery) {
        this.discovery = discovery;
    }

    public static <T> T create(Class<T> interfaceClass){

//        return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(),
//                new Class<?>[]{interfaceClass},
//                new ObjectProxy<T>(interfaceClass)
//        );

        return null;

    }

    public void stop(){
        discovery.stop();
        ConnectManage.me().stop();
    }
}
